from datetime import datetime
from typing import List, Dict

import class_demo.module1 as m1

# import class_demo.module2 as m2
# import class_demo.module3 as m3

import python_data_type.slice_demo as sd


def return_num() -> int:
    return 1


def print_hi(name):
    # Use a breakpoint in the code line below to debug your script.
    print(f'Hi, {name}')  # Press ⌘F8 to toggle the breakpoint.


def add_one(a: int, b: int) -> int:
    return a - b


def return_dict() -> dict:
    _dict = {'Alice': 2021001, 'Beth': 2021002, 'Cecil': 2021003}
    return _dict


# python 不需要定义返回值
def return_without_definition():
    dict1 = {'Alice': 2021001, 'Beth': 2021002, 'Cecil': 2021003}
    return dict1


def list_dict_demo() -> List[Dict]:
    dict1 = {"a": 1, "b": 2, "c": 3}
    dict2 = {"a": 2, "b": 3, "c": 4}
    dict3 = {"a": 1, "b": 5, "c": 6}
    list_dir = [dict1, dict2, dict3]
    return list_dir


def return_value_with_if_else(param: int):
    # if param != 1 return 1 否则 return 0
    return 1 if param != 1 else 0


def test_not():
    _dict = {"key1": "value1", "key2": "value2"}
    # _dict = {}
    if not _dict:
        print("_dict 为None或为空{}")
    else:
        print("_dict不为None也不为空{}")


def return_multi_values(_list):
    _sum = 0
    count = 0
    for e in _list:
        if isinstance(e, int) or isinstance(e, float):
            count += 1
            _sum += e

    return _sum, _sum / count


def return_int():
    return 1


# Press the green button in the gutter to run the script.
def return_list_dict():
    a: int = return_int()
    pass


def upsert_unique_task(**kwargs):
    print('type of **kwargs is ', type(kwargs))
    print(kwargs)


if __name__ == '__main__':
    _str = '{} {}/{}'.format('K1GEE03', '99', '99_new')
    print(_str)
